package com.zjdiepu.www.model.base.ext;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.zjdiepu.www.base.core.PageExt;
import com.zjdiepu.www.base.enums.type.LoginType;
import com.zjdiepu.www.common.util.CollectionInitUtil;

/**
 * 用户表<br/>
 * 
 * @author xiongxiaotun<br/>
 * @time 2017年04月05日 15时24分<br/>
 * @since 1.0<br/>
 */
public class SysUserExt extends PageExt {

	private static final long serialVersionUID = 1L;
	/**
	 * 登录用户名称
	 */
	private String loginName;

	/**
	 * 登录用户密码
	 */
	private String loginPass;

	/**
	 * 用户姓名
	 */
	private String uname;

	/**
	 * 手机号码
	 */
	private String phone;

	/**
	 * 性别
	 */
	private String sex;

	/**
	 * 身份证号码
	 */
	private String identity;

	/**
	 * 用户邮箱
	 */
	private String mailbox;

	/**
	 * 职位编号
	 */
	private String positionId;

	/**
	 * 公司编号
	 */
	private String companyId;

	/**
	 * 部门编号
	 */
	private String orgId;

	/**
	 * 业务员ID
	 */
	private String salersmanId;

	/**
	 * 业务员编码
	 */
	private String salersmanCode;

	/**
	 * 连接编号
	 */
	private String connectId;

	/**
	 * 公众号标识
	 */
	private String openid;
	/**
	 * 开放平台标识
	 */
	private String uinitid;

	/**
	 * 登录类型 {@link LoginType}
	 */
	private Integer loginType;

	/**
	 * 头像
	 */
	private String headerImage;

	/**
	 * 账号类型 1.业务员 2.非业务员
	 */
	private Integer accountType;

	/**
	 * 贷款银行
	 */
	private String loanBank;

	// ================辅助字段=====================
	/**
	 * 角色
	 */
	private List<String> roleIds;

	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getLoginPass() {
		return this.loginPass;
	}

	public void setLoginPass(String loginPass) {
		this.loginPass = loginPass;
	}

	public String getUname() {
		return this.uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getIdentity() {
		return this.identity;
	}

	public void setIdentity(String identity) {
		this.identity = identity;
	}

	public String getMailbox() {
		return this.mailbox;
	}

	public void setMailbox(String mailbox) {
		this.mailbox = mailbox;
	}

	public String getPositionId() {
		return this.positionId;
	}

	public void setPositionId(String positionId) {
		this.positionId = positionId;
	}

	public String getCompanyId() {
		return this.companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	public String getOrgId() {
		return this.orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getSalersmanId() {
		return salersmanId;
	}

	public void setSalersmanId(String salersmanId) {
		this.salersmanId = salersmanId;
	}

	public String getSalersmanCode() {
		return salersmanCode;
	}

	public void setSalersmanCode(String salersmanCode) {
		this.salersmanCode = salersmanCode;
	}

	public String getConnectId() {
		return this.connectId;
	}

	public void setConnectId(String connectId) {
		this.connectId = connectId;
	}

	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}

	public String getUinitid() {
		return uinitid;
	}

	public void setUinitid(String uinitid) {
		this.uinitid = uinitid;
	}

	public Integer getLoginType() {
		return loginType;
	}

	public void setLoginType(Integer loginType) {
		this.loginType = loginType;
	}

	public String getHeaderImage() {
		return headerImage;
	}

	public void setHeaderImage(String headerImage) {
		this.headerImage = headerImage;
	}

	public Integer getAccountType() {
		return accountType;
	}

	public void setAccountType(Integer accountType) {
		this.accountType = accountType;
	}

	public String getLoanBank() {
		return loanBank;
	}

	public void setLoanBank(String loanBank) {
		this.loanBank = loanBank;
	}

	/**
	 * 添加角色
	 * 
	 * @author xiongxiaotun <br/>
	 * @Title: addRoleId <br/>
	 * @Description:添加角色 <br/>
	 * @param roleId
	 * @return
	 * @version V1.0 <br/>
	 */
	public List<String> addRoleId(String roleId) {
		if (null == roleIds) {
			roleIds = CollectionInitUtil.emptyList();
		}
		if (StringUtils.isNotBlank(roleId)) {
			roleIds.add(roleId);
		}
		return roleIds;
	}

	public List<String> getRoleIds() {
		return roleIds;
	}

	public void setRoleIds(List<String> roleIds) {
		this.roleIds = roleIds;
	}

	@Override
	public String toString() {
		return "SysUserExt [loginName=" + loginName + ", loginPass="
				+ loginPass + ", uname=" + uname + ", phone=" + phone
				+ ", sex=" + sex + ", identity=" + identity + ", mailbox="
				+ mailbox + ", positionId=" + positionId + ", companyId="
				+ companyId + ", orgId=" + orgId + ", connectId=" + connectId
				+ ", openid=" + openid + ", uinitid=" + uinitid
				+ ", loginType=" + loginType + ", headerImage=" + headerImage
				+ ", accountType=" + accountType + "]";
	}
}